#include "bsp_encoder.h"

void Encoder_Init()
{
	HAL_TIM_Encoder_Start(&htim1, TIM_CHANNEL_ALL);
	HAL_TIM_Encoder_Start(&htim3, TIM_CHANNEL_ALL);
	HAL_TIM_Encoder_Start(&htim4, TIM_CHANNEL_ALL);
	HAL_TIM_Encoder_Start(&htim8, TIM_CHANNEL_ALL);
}



//uint8_t Get_Encoder_Dir(TIM_HandleTypeDef* htimx)
//{
//	return __HAL_TIM_IS_TIM_COUNTING_DOWN(htimx);
//}

uint8_t Get_Encoder_Dir(TIM_HandleTypeDef* htiml)
{
	return __HAL_TIM_IS_TIM_COUNTING_DOWN(htiml);
}

uint16_t Get_Encoder_data(TIM_HandleTypeDef* htiml)
{
	return __HAL_TIM_GET_COUNTER(htiml);
}
	

